package com.zhong.bmob.server;

import com.zhong.bmob.inter.ISaveDown;

import cn.bmob.v3.BmobObject;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;

/**
 * Created by 俊峰 on 2017/5/27.
 */

public class Save {
    public static void saveDataToBmob(BmobObject object, ISaveDown iSaveDown){
        final ISaveDown saveDown = iSaveDown;
        object.save(new SaveListener<String>() {
            @Override
            public void done(String s, BmobException e) {
                if (e == null){
                    saveDown.saveSuccess();
                }else {
                    saveDown.saveFailed(e);
                }
            }
        });
    }
}
